package cn.alex.sso.project.controller;

import cn.alex.sso.framework.core.Result;
import cn.alex.sso.project.entity.params.SaveSysClientDataSync;
import cn.alex.sso.project.service.SysClientSyncService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 应用数据同步设置
 *
 * @author Alex
 * @date 2024/12/4 22:37
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/client/data/sync")
public class SysClientDataSyncController {
    private final SysClientSyncService baseService;


    /**
     * 查询系统中数据同步的模块及类型列表
     */
    @GetMapping("/getInfo/{clientId}")
    public Result getInfo(@PathVariable Long clientId) {
        return Result.ok(baseService.getInfo(clientId));
    }

    /**
     * 提交
     */
    @PostMapping("/save")
    public Result save(@RequestBody SaveSysClientDataSync entity) {
        baseService.save(entity);
        return Result.ok();
    }


}
